package cn.dengta.webapp.trade.vo;

import java.math.BigDecimal;
import java.util.Map;

import cn.dengta.common.util.Formats;
import cn.dengta.webapp.base.vo.AbstractVO;
import cn.dengta.webapp.trade.entity.UserIntegral;
import com.alibaba.fastjson.JSONArray;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

@Setter
@Getter
@Accessors(chain = true)
public class UserIntegralVO extends AbstractVO<UserIntegral> {

	public Map<String, Object> user;
	public Map<String, Object> agent;
	/** 资金总额 */
	protected BigDecimal totalAmount;
	/** 可用余额 */
	protected BigDecimal activeAmount;
	/** 冻结金额 */
	protected BigDecimal frozenAmount;
	/** 最后一次提现国家 */
	protected String lastCountry;
	/** 可选国家 */
	protected JSONArray country;
	/** 今日收益 */
	private BigDecimal todayIncome;
	/** 昨日收益 */
	private BigDecimal yesterdayIncome;

	public static UserIntegralVO from(UserIntegral source) {
		return copy(source, UserIntegralVO::new);
	}

	public String getTotalAmount() {
		return Formats.formatNumber_D(totalAmount);
	}

	public String getActiveAmount() {
		return Formats.formatNumber_D(activeAmount);
	}

	public String getFrozenAmount() {
		return Formats.formatNumber_D(frozenAmount);
	}

	public String getTodayIncome() {
		return Formats.formatNumber_D(todayIncome);
	}

	public String getYesterdayIncome() {
		return Formats.formatNumber_D(yesterdayIncome);
	}

}
